package com.example.fragmentdemo;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;


public class CustomFragment extends Fragment {


    @Override
    public void onAttach(@NonNull Context context) {
        Log.e("androidLog","Fragment onAttach");
        super.onAttach(context);
    }


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Log.e("androidLog","Fragment onCreateView");
        View view = inflater.inflate(R.layout.fragment_main,container,false);
        ImageView imageView = view.findViewById(R.id.tv);

        Glide.with(getActivity()).load(Uri.parse("https://upload-images.jianshu.io/upload_images/595349-6ffdbb24d4945fa4.png?imageMogr2/auto-orient/strip|imageView2/2")).into(imageView);
        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        Log.e("androidLog","Fragment onViewCreated");
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        Log.e("androidLog","Fragment onCreate");
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        Log.e("androidLog","Fragment onActivityCreated");
        super.onActivityCreated(savedInstanceState);
    }

    @Override
    public void onStart() {
        Log.e("androidLog","Fragment onStart");
        super.onStart();
    }

    @Override
    public void onResume() {
        Log.e("androidLog","Fragment onResume");
        super.onResume();
    }

    @Override
    public void onDestroyView() {
        Log.e("androidLog","Fragment onDestroyView");
        super.onDestroyView();
    }

    @Override
    public void onDestroy() {
        Log.e("androidLog","Fragment onDestroy");
        super.onDestroy();
    }

    @Override
    public void onDetach() {
        Log.e("androidLog","Fragment onDetach");
        super.onDetach();
    }
}
